package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysShopProductMapper;
import com.ruoyi.system.domain.SysShopProduct;
import com.ruoyi.system.service.ISysShopProductService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商品管理Service业务层处理
 * 
 * @author yangqg
 * @date 2021-11-30
 */
@Service
public class SysShopProductServiceImpl implements ISysShopProductService 
{
    @Autowired
    private SysShopProductMapper sysShopProductMapper;

    /**
     * 查询商品管理
     * 
     * @param productid 商品管理主键
     * @return 商品管理
     */
    @Override
    public SysShopProduct selectSysShopProductByProductid(Long productid)
    {
        return sysShopProductMapper.selectSysShopProductByProductid(productid);
    }

    /**
     * 查询商品管理列表
     * 
     * @param sysShopProduct 商品管理
     * @return 商品管理
     */
    @Override
    public List<SysShopProduct> selectSysShopProductList(SysShopProduct sysShopProduct)
    {
        return sysShopProductMapper.selectSysShopProductList(sysShopProduct);
    }

    /**
     * 新增商品管理
     * 
     * @param sysShopProduct 商品管理
     * @return 结果
     */
    @Override
    public int insertSysShopProduct(SysShopProduct sysShopProduct)
    {
        sysShopProduct.setCreateTime(new Date());
        return sysShopProductMapper.insertSysShopProduct(sysShopProduct);
    }

    /**
     * 修改商品管理
     * 
     * @param sysShopProduct 商品管理
     * @return 结果
     */
    @Override
    public int updateSysShopProduct(SysShopProduct sysShopProduct)
    {
        return sysShopProductMapper.updateSysShopProduct(sysShopProduct);
    }

    /**
     * 批量删除商品管理
     * 
     * @param productids 需要删除的商品管理主键
     * @return 结果
     */
    @Override
    public int deleteSysShopProductByProductids(String productids)
    {
        return sysShopProductMapper.deleteSysShopProductByProductids(Convert.toStrArray(productids));
    }

    /**
     * 删除商品管理信息
     * 
     * @param productid 商品管理主键
     * @return 结果
     */
    @Override
    public int deleteSysShopProductByProductid(Long productid)
    {
        return sysShopProductMapper.deleteSysShopProductByProductid(productid);
    }
}
